package com.osfw.activiti.domain;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.osfw.activiti.entity.running.ActRuExec;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.List;


/**
 * 流程节点执行结果
 */
@Data
@Accessors(chain = true)
public class ProcessExecResult implements Serializable {
    private static final long serialVersionUID = 1L;

    /* 当前节点执行结果（1-节点执行中，2-节点已结束，3-流程已结束） */
    private Integer result;

    /* 下个节点待执行数据 */
    private List<ActRuExec> nextNodeExceinsts;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("result", getResult())
                .append("nextNodeExceinsts", JSONArray.toJSONString(getNextNodeExceinsts()))
                .toString();
    }

}
